package com.efast.dmom.equipment.opc.client;

import org.jinterop.dcom.common.JIException;
import org.jinterop.dcom.core.JIVariant;
import org.openscada.opc.lib.da.DataCallback;
import org.openscada.opc.lib.da.Item;
import org.openscada.opc.lib.da.ItemState;

public class StatusCallBack implements DataCallback {

	public void changed(Item item, ItemState itemState) {

		try {
			if (itemState.getValue().getType() == JIVariant.VT_I2) {
				short n = itemState.getValue().getObjectAsShort();
				System.out.println("Heartbeat callback: " + n);
			}
		} catch (JIException e) {
			e.printStackTrace();
		}
	}

}
